home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / bash1135 / lib / glob / makefile
Makefile  |  1994-02-20  |  3KB  |  92 lines

  1. ## -*- text -*- ####################################################
  2. #                                   #
  3. # Makefile for the GNU Glob Library.                   #
  4. #                                   #
  5. ####################################################################
  6.  
  7. # This Makefile is hand made from a template file, found in
  8. # ../template.  Each library must provide several Makefile
  9. # targets: `all', `clean', `documentation', `install', and
  10. # `what-tar'.  The `what-tar' target reports the names of the
  11. # files that need to be included in a tarfile to build the full
  12. # code and documentation for this library.
  13.  
  14. # Please note that the values for INCLUDES, CC, AR, RM, CP,
  15. # RANLIB, and selfdir are passed in from ../Makefile, and do
  16. # not need to be defined here.
  17.  
  18. # Here is a rule for making .o files from .c files that doesn't force
  19. # the type of the machine (like -sun3) into the flags.
  20. .c.o:
  21.     $(CC) -c $(CFLAGS) $(INCLUDES) $(LOCAL_DEFINES) $(CPPFLAGS) $*.c
  22.  
  23. # LOCAL_DEFINES are flags that are specific to this library.
  24. # Define -DUSG if you are using a System V operating system.
  25. LOCAL_DEFINES = $(LOCAL_INCLUDES) #-DUSG
  26.  
  27. # For libraries which include headers from other libraries.
  28. LOCAL_INCLUDES = -I../
  29.  
  30. # The name of the library target.
  31. LIBRARY_NAME = libglob.a
  32.  
  33. # The C code source files for this library.
  34. CSOURCES = glob.c fnmatch.c
  35.  
  36. # The header files for this library.
  37. HSOURCES = fnmatch.h
  38.  
  39. OBJECTS = glob.o fnmatch.o
  40.  
  41. # The texinfo files which document this library.
  42. DOCSOURCE = doc/glob.texi
  43. DOCOBJECT = doc/glob.dvi
  44. DOCSUPPORT = doc/Makefile
  45. DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
  46.  
  47. SUPPORT = Makefile ChangeLog $(DOCSUPPORT)
  48.  
  49. SOURCES  = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
  50.  
  51. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  52.  
  53. ######################################################################
  54.  
  55. all: $(LIBRARY_NAME)
  56.  
  57. $(LIBRARY_NAME): $(OBJECTS)
  58.     $(RM) $@
  59.     $(AR) cr $@ $(OBJECTS)
  60.     -if [ -f "$(RANLIB)" ]; then $(RANLIB) $@; fi
  61.     $(RM) $(patsubst lib%.a,%.olb,$@)
  62.     ln $@ $(patsubst lib%.a,%.olb,$@)
  63.  
  64. what-tar:
  65.     @for file in $(THINGS_TO_TAR); do \
  66.       echo $(selfdir)$$file; \
  67.     done
  68.  
  69. documentation: force
  70.     make -C doc
  71. force:
  72.  
  73. # The rule for 'includes' is written funny so that the if statement
  74. # always returns TRUE unless there really was an error installing the
  75. # include files.
  76. install:
  77.     -$(MV) $(bindir)/$(LIBRARY_NAME) $(bindir)/$(LIBRARY_NAME)-old
  78.     $(CP) $(LIBRARY_NAME) $(bindir)/$(LIBRARY_NAME)
  79.     if [ -f "$(RANLIB)" ]; then $(RANLIB) -t $(bindir)/$(LIBRARY_NAME); fi
  80.  
  81. clean:
  82.     rm -f $(OBJECTS) $(LIBRARY_NAME)
  83.     make -C doc clean
  84.  
  85.  
  86. ######################################################################
  87. #                                     #
  88. #  Dependencies for the object files which make up this library.     #
  89. #                                     #
  90. ######################################################################
  91.  
  92. fnmatch.o: fnmatch.c fnmatch.h